<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>
<c:set var="AVALIABLE" value="<%=ConstantDB.AVALIABLE%>"></c:set>
<c:set var="UNAVALIABLE" value="<%=ConstantDB.UNAVALIABLE%>"></c:set>

<c:set var="COMMEND_DISPLAY_0" value="<%=ConstantDB.COMMEND_DISPLAY_0%>"></c:set>
<c:set var="COMMEND_DISPLAY_1" value="<%=ConstantDB.COMMEND_DISPLAY_1%>"></c:set>
<c:set var="COMMEND_DISPLAY_2" value="<%=ConstantDB.COMMEND_DISPLAY_2%>"></c:set>
<c:set var="COMMEND_DISPLAY_3" value="<%=ConstantDB.COMMEND_DISPLAY_3%>"></c:set>
<c:set var="COMMEND_DISPLAY_4" value="<%=ConstantDB.COMMEND_DISPLAY_4%>"></c:set>
<c:set var="COMMEND_DISPLAY_5" value="<%=ConstantDB.COMMEND_DISPLAY_5%>"></c:set>
<c:set var="COMMEND_DISPLAY_6" value="<%=ConstantDB.COMMEND_DISPLAY_6%>"></c:set>
<c:set var="COMMEND_DISPLAY_7" value="<%=ConstantDB.COMMEND_DISPLAY_7%>"></c:set>
<c:set var="COMMEND_DISPLAY_8" value="<%=ConstantDB.COMMEND_DISPLAY_8%>"></c:set>
<c:set var="COMMEND_DISPLAY_9" value="<%=ConstantDB.COMMEND_DISPLAY_9%>"></c:set>
<c:set var="COMMEND_DISPLAY_10" value="<%=ConstantDB.COMMEND_DISPLAY_10%>"></c:set>
<c:set var="COMMEND_DISPLAY_11" value="<%=ConstantDB.COMMEND_DISPLAY_11%>"></c:set>
<c:set var="COMMEND_DISPLAY_12" value="<%=ConstantDB.COMMEND_DISPLAY_12%>"></c:set>
<c:set var="COMMEND_DISPLAY_13" value="<%=ConstantDB.COMMEND_DISPLAY_13%>"></c:set>
<c:set var="COMMEND_DISPLAY_14" value="<%=ConstantDB.COMMEND_DISPLAY_14%>"></c:set>
<c:set var="COMMEND_DISPLAY_15" value="<%=ConstantDB.COMMEND_DISPLAY_15%>"></c:set>
<c:set var="COMMEND_DISPLAY_16" value="<%=ConstantDB.COMMEND_DISPLAY_16%>"></c:set>
<c:set var="COMMEND_DISPLAY_17" value="<%=ConstantDB.COMMEND_DISPLAY_17%>"></c:set>
<c:set var="COMMEND_DISPLAY_18" value="<%=ConstantDB.COMMEND_DISPLAY_18%>"></c:set>

<c:set var="COMMEND_DISPLAY_19" value="<%=ConstantDB.COMMEND_DISPLAY_19%>"></c:set>
<c:set var="COMMEND_DISPLAY_20" value="<%=ConstantDB.COMMEND_DISPLAY_20%>"></c:set>
<c:set var="COMMEND_DISPLAY_21" value="<%=ConstantDB.COMMEND_DISPLAY_21%>"></c:set>
<c:set var="COMMEND_DISPLAY_22" value="<%=ConstantDB.COMMEND_DISPLAY_22%>"></c:set>
<c:set var="COMMEND_DISPLAY_23" value="<%=ConstantDB.COMMEND_DISPLAY_23%>"></c:set>
<c:set var="COMMEND_DISPLAY_24" value="<%=ConstantDB.COMMEND_DISPLAY_24%>"></c:set>
<c:set var="COMMEND_DISPLAY_25" value="<%=ConstantDB.COMMEND_DISPLAY_25%>"></c:set>

<c:set var="COMMEND_TYPE_BBS_TOPIC" value="<%=ConstantDB.COMMEND_TYPE_BBS_TOPIC%>"></c:set>
<c:set var="COMMEND_TYPE_SPACE_BLOG" value="<%=ConstantDB.COMMEND_TYPE_SPACE_BLOG%>"></c:set>
<c:set var="COMMEND_TYPE_QUESTION" value="<%=ConstantDB.COMMEND_TYPE_QUESTION%>"></c:set>
<c:set var="COMMEND_TYPE_KLG" value="<%=ConstantDB.COMMEND_TYPE_KLG%>"></c:set>

<c:set var="COMMEND_LEVEL_TOPEST" value="<%=ConstantDB.COMMEND_LEVEL_TOPEST%>"></c:set>
<c:set var="COMMEND_LEVEL_MIDDLE" value="<%=ConstantDB.COMMEND_LEVEL_MIDDLE%>"></c:set>
<c:set var="COMMEND_LEVEL_LOW" value="<%=ConstantDB.COMMEND_LEVEL_LOW%>"></c:set>

<c:set var="AUDIT_NONE" value="<%=ConstantDB.AUDIT_NONE%>"></c:set>
<c:set var="AUDIT_TODO" value="<%=ConstantDB.AUDIT_TODO%>"></c:set>
<c:set var="AUDIT_PASS" value="<%=ConstantDB.AUDIT_PASS%>"></c:set>
<c:set var="AUDIT_REJECT" value="<%=ConstantDB.AUDIT_REJECT%>"></c:set>

<script type="text/javascript">
function toUpdate(){
	var array = [];
	var url = "<c:url value='/admin/commend/update.do' />";
	sns.toUpdate(url, array, 'ck_commends','commendid');
}
function removeCommend(){
	var array = [];
	var url = "<c:url value='/admin/commend/remove.do' />";
	sns.dynaRemove(url, array, 'ck_commends','commendIds','id-commend-');
}
</script>
<div class="bu">
<form action="<c:url value='/admin/commend/query.do'/>" action="POST">
	来源类型：
	<select name="commend.commendType">
		<option value="0">NULL</option>
		<option value="${COMMEND_TYPE_BBS_TOPIC}">BBS TOPIC</option>
		<option value="${COMMEND_TYPE_SPACE_BLOG}">SPACE BLOG</option>
		<option value="${COMMEND_TYPE_QUESTION}">Question</option>
		<option value="${COMMEND_TYPE_KLG}">KLG</option>
	</select>
	显示位置:
	<select name="commend.commendDisplay">
		<option value="${COMMEND_DISPLAY_0}">默认值,需要修改否则不可使用</option>
		<option value="${COMMEND_DISPLAY_19}">网站首页滚动图片，从BBS获得</option>
		<option value="${COMMEND_DISPLAY_20}">网站首页大标题新闻，从BBS获得</option>
		<option value="${COMMEND_DISPLAY_21}">网站首页大标题新闻下小标题，从BBS获得</option>
		<option value="${COMMEND_DISPLAY_22}">网站首页大标题新闻下小标题图片，从BBS获得</option>
		
		<option value="${COMMEND_DISPLAY_23}">网站首页Hot最右边图片，从BBS获得</option>
		<option value="${COMMEND_DISPLAY_24}">网站首页BBS标题新闻，从BBS获得</option>
		<option value="${COMMEND_DISPLAY_25}">网站首页BBS图片，从BBS获得</option>
		
		<option value="${COMMEND_DISPLAY_1}">BBS首页滚动图片</option>
		<option value="${COMMEND_DISPLAY_2}">BBS首页标题新闻</option>
		<option value="${COMMEND_DISPLAY_13}">BBS首页标题新闻下面的小推荐</option>
		<option value="${COMMEND_DISPLAY_14}">BBS首页公告</option>
		<option value="${COMMEND_DISPLAY_3}">BBS推荐话题</option>
		<option value="${COMMEND_DISPLAY_4}">BBS首页各大版区推荐图片</option>
		<option value="${COMMEND_DISPLAY_5}">BBS首页各大版区推荐图片下的帖子列表</option>
		<option value="${COMMEND_DISPLAY_15}">BBS首页各大版区标题新闻</option>
		<option value="${COMMEND_DISPLAY_16}">BBS首页各大版区标题新闻下的帖子列表</option>
		<option value="${COMMEND_DISPLAY_6}">问答首页图片</option>
		<option value="${COMMEND_DISPLAY_7}">问答首页推荐问题</option>
		<option value="${COMMEND_DISPLAY_8}">妈妈关心的问题</option>
		<option value="${COMMEND_DISPLAY_9}">宝宝关心的问题</option>
		<option value="${COMMEND_DISPLAY_10}">10: 知识主Segment首页推荐图片.comments字段存放segmentid</option>
		<option value="${COMMEND_DISPLAY_11}">11: 知识主Segment首页推荐大标题.comments字段存放segmentid</option>
		<option value="${COMMEND_DISPLAY_12}">12: 知识主Segment首页各子Segment的推荐.comments字段存放子segmentid</option>
		<option value="${COMMEND_DISPLAY_17}">知识中关于妈妈的推荐(网站首页使用)</option>
		<option value="${COMMEND_DISPLAY_18}">知识中关于宝宝的推荐(网站首页使用)</option>
	</select>
	<br/>
	<input type="submit" name="查询" value="查询"/>
</form>
</div>
<div class="bu">
<button onclick="toUpdate()" title="UPDATE"><fmt:message key="common.update"/></button>&nbsp;&nbsp;
<button onclick="removeCommend()" title="DELETE"><fmt:message key="common.delete"/></button>&nbsp;&nbsp;
</div>
<div>
<table id="t_commend_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">来源类型</th>
			<th width="200px" class="tdCenter">显示位置</th>
			<th width="75px" class="tdCenter">是否可用</th>
			<th width="75px" class="tdCenter">审核状态</th>
			<th width="75px" class="tdCenter">推荐等级</th>
			<th class="tdCenter">描述</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="commend" items="${page.items}" varStatus="status">
		<tr id="id-commend-${commend.commendId}">
			<td class="tdCenter">
				<input type="checkbox" name="ck_commends" id="ck_<c:out value='${commend.commendId}' />" value="${commend.commendId}"></input>
			</td>
			<td class="tdCenter">
				<c:if test="${commend.commendType == COMMEND_TYPE_BBS_TOPIC}">
					BBS TOPIC
				</c:if>
				<c:if test="${commend.commendType == COMMEND_TYPE_SPACE_BLOG}">
					SPACE BLOG
				</c:if>
				<c:if test="${commend.commendType == COMMEND_TYPE_QUESTION}">
					问答
				</c:if>
				<c:if test="${commend.commendType == COMMEND_TYPE_KLG}">
					知识
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_0}">
					0：默认值,需要修改否则不可使用
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_19}">
					19：网站首页滚动图片，从BBS获得
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_20}">
					20：网站首页大标题新闻，从BBS获得
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_21}">
					21：网站首页大标题新闻下小标题，从BBS获得
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_22}">
					22：网站首页大标题新闻下小标题图片，从BBS获得
				</c:if>
				
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_23}">
					23：网站首页Hot最右边图片，从BBS获得
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_24}">
					24：网站首页BBS标题新闻，从BBS获得
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_25}">
					25：网站首页BBS图片，从BBS获得
				</c:if>
				
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_1}">
					1：BBS首页滚动图片
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_2}">
					2：BBS首页标题新闻
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_13}">
					13：BBS首页标题新闻下面的小推荐
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_14}">
					14：BBS首页公告
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_3}">
					3: BBS推荐话题
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_4}">
					4: BBS首页各大版区推荐图片
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_5}">
					5: BBS首页各大版区推荐图片下的帖子列表
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_15}">
					15: BBS首页各大版区标题新闻
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_16}">
					16: BBS首页各大版区标题新闻下的帖子列表
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_6}">
					6: 问答首页图片
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_7}">
					7: 问答首页推荐问题
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_8}">
					8: 妈妈关心的问题
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_9}">
					9: 宝宝关心的问题
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_10}">
					10: 知识主Segment首页推荐图片.comments字段存放segmentid
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_11}">
					11: 知识主Segment首页推荐大标题.comments字段存放segmentid
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_12}">
					12: 知识主Segment首页各子Segment的推荐.comments字段存放子segmentid
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_17}">
					17：知识中关于妈妈的推荐(网站首页使用)
				</c:if>
				<c:if test="${commend.commendDisplay == COMMEND_DISPLAY_18}">
					18：知识中关于宝宝的推荐(网站首页使用)
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${commend.enabled == UNAVALIABLE}">
					<fmt:message key="common.notenabled"/>
				</c:if>
				<c:if test="${commend.enabled == AVALIABLE}">
					<fmt:message key="common.enabled"/>
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${commend.audit == AUDIT_NONE}">
					未处理
				</c:if>
				<c:if test="${commend.audit == AUDIT_TODO}">
					已经处理，但是不确定
				</c:if>
				<c:if test="${commend.audit ==AUDIT_PASS}">
					通过
				</c:if>
				<c:if test="${commend.audit == AUDIT_REJECT}">
					不通过
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${commend.commendLevel == COMMEND_LEVEL_TOPEST}">
					1 最高
				</c:if>
				<c:if test="${commend.commendLevel == COMMEND_LEVEL_MIDDLE}">
					2 中级
				</c:if>
				<c:if test="${commend.commendLevel == COMMEND_LEVEL_LOW}">
					3 低
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${commend.commendType == COMMEND_TYPE_BBS_TOPIC}">
					<ms:board type="boardnameall" property="${commend.entityId}"></ms:board><br/>
					<ms:title entity="${commend.entityId}" type="topic"></ms:title>
				</c:if>
				<c:if test="${commend.commendType == COMMEND_TYPE_SPACE_BLOG}">
					<ms:title entity="${commend.entityId}" type="blog"></ms:title>
				</c:if>
				<c:if test="${commend.commendType == COMMEND_TYPE_QUESTION}">
					<ms:title entity="${commend.entityId}" type="question"></ms:title>
				</c:if>
				<c:if test="${commend.commendType == COMMEND_TYPE_KLG}">
					<ms:klg action="typeNameAll" id="${commend.entityId}"></ms:klg><br/>
					<ms:title entity="${commend.entityId}" type="klg"></ms:title>
				</c:if>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
</div>
<br/>